package com.mitaotao._1_语法._4_循环.单循环._02_求和1到100;

public class _02_3_求和doWhile {
//    public static void main(String[] args) {
//        int sum = 0;
//        int num = 0;
//        do {
//            sum = sum+num;
//            num++;
//        }while(num<=100);
//        System.out.println("1-100的和为："+sum);
//    }

    public static void main(String[] args) {
        int sum = 0;
        int num = 1;
        do {
            sum = sum+num;
            num++;
        }while(num<=100);
        System.out.println("1-100的和为："+sum);
    }
}
